package com.coreservlets.jsf.ss08;

import javax.faces.bean.ManagedBean;

@ManagedBean
public class SimpleController
{
	private String message = "";

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public String doNavigation()
	{
		if( getMessage().trim().length() < 2 )
		{
			return( "too-short" );
		}
		else
		{
			String[] results = { "page1", "page2", "page3" };
			
			return( results[ new java.util.Random().nextInt( 3 ) ] );
		}
	}
}